import request from '@/utils/request'

// 查询赛事列表
export function findCompetitionList(query) {
  return request({
    url: '/competition/list',
    method: 'get',
    params: query
  })
}

// 新增赛事
export function addCompetition(data) {
  return request({
    url: '/competition/addCompetition',
    method: 'post',
    data: data
  })
}
// 查看赛事详情
export function findCompetitionDetail(data) {
  return request({
    url: '/competition/findCompetitionDetail',
    method: 'post',
    data: data
  })
}

// 修改赛事
export function updateCompetition(data) {
  return request({
    url: '/competition/updateCompetition',
    method: 'post',
    data: data
  })
}

// 删除赛事
export function deleteCompetition(data) {
  return request({
    url: '/competition/deleteCompetition',
    method: 'post',
    data: data
  })
}


















// 查询我的工单详细
export function getMyOrder(id) {
  return request({
    url: '/workOrder/myOrder/' + id,
    method: 'get'
  })
}

// 查询我的工单附件
export function orderDetail(id) {
  // console.log("wwwwwwwww")
  return request({
    url: '/workOrder/myOrder/getDetail/' + id,
    method: 'get'
  })
}

// 新增我的工单
export function addMyOrder(data) {
  return request({
    url: '/workOrder/myOrder',
    method: 'post',
    data: data
  })
}

// 修改我的工单
export function updateMyOrder(data) {
  return request({
    url: '/workOrder/myOrder',
    method: 'put',
    data: data
  })
}

// 删除我的工单
export function delMyOrder(id) {
  return request({
    url: '/workOrder/myOrder/' + id,
    method: 'delete'
  })
}

//接单人列表
export function pickupPersonList(projectCode) {
  return request({
    url: '/workOrder/myOrder/getDealPerson/'+projectCode,
    method: 'get'
  })
}

//转单确认
export function transferSure(data) {
  return request({
    url: '/workOrder/myOrder/revert',
    method: 'post',
    data: data
  })
}

//完成工单
export function finishMyOrder(data) {
  return request({
    url: '/workOrder/myOrder/finish',
    method: 'post',
    data: data
  })
}

//关闭工单
export function closeMyOrder(data) {
  return request({
    url: '/workOrder/myOrder/close',
    method: 'post',
    data: data
  })
}

//受理
export function acceptCaseOrder(data) {
  return request({
    url: '/workOrder/myOrder/accept',
    method: 'post',
    data: data
  })
}

//工单编号
export function getOrderNumber(projectCode) {
  return request({
    url: '/system/dict/data/data/'+projectCode,
    method: 'get'
  })
}


export  function submitOrder(data) {
  return request({
    url: '/workOrder/myOrder/submitOrder',
    method: 'post',
    data: data
  })
}
